home *** CD-ROM | disk | FTP | other *** search
- #!/bin/csh
-
- # ****************************************************************************
- # FILE : configure
- # SHORTNAME: config
-
- # PURPOSE : Shell scipt to create three make files
- # 1) kernel in the directory kernel/source
- # 2) X user interface in xgui/source
- # 3) tools in tools/source
-
- # AUTHOR : Tilman Sommer, Niels Mache, Ralf Huebner
- # DATE : 17.02.92
-
- # MODIFICATIONS :
- # 01.02.91 lines 222-225, 241-256 inserted. (Thomas Korb)
- # 22.05.91 some cosmetic changes (A. Zell)
- # 25.06.91 line 165 -DSYSTEMV (-> compiler, setbuffer())
- # 28.11.91 changes for V1.4: new Makefiles, sun4 dir. renamed to sparc
- # (N. Mache)
- # 17.12.91 changes for X11R4: new directory paths (R. Huebner)
- # 17.02.92 build all, build compiler commented out (A. Zell)
- # 25.02.92 changes for X11R5, installation of RS6000 (R. Huebner)
- # 03.03.92 query, if X11 Files not found (R. Huebner)
- # 23.03.93 update for version 3.0 (R. Huebner)
- # 04.05.93 1) check for $xh/X11/Xaw/Label.h, not only for directory
- # 2) allow 'unknown' for lib and header paths
- # (H. Bayer)
- # 13.08.93 Tools options added (R. Huebner)
- # 24.08.93 Changes for Solaris (R. Huebner)
- # 17.12.93 New dependency checks
- # 17.03.94 sgi update (R.Huebner)
- # 22.03.94 changed permission for Makefiles (M. Vogt)
- # 05.04.94 new bin directory structure, dec alpha update (R.Huebner)
- #
- # (c) 1991 - 94 by SNNS-Group
- # Institute for Parallel and Distributed High Performance Systems
- # University of Stuttgart, FRG
- # ****************************************************************************
-
-
-
- echo "************************************************"
- echo "* *"
- echo "* SNNS - Stuttgart Neural Network Simulator *"
- echo "* *"
- echo "* Installation of Version 3.2 *"
- echo "* *"
- echo "************************************************"
- echo ""
- echo " - for use with X11R4 or X11R5 and Athena Toolkit"
- echo " - needs ansi C-Compiler"
- echo " - monochrome and color/grayscale displays"
- echo " - on Sun Sparcs, DecStations, RS6000,"
- echo " HP 9000 series, 386/486 PC, Silicon Graphics"
- echo " and (hopefully) other machines"
- echo " - It is possible to install SNNS for different types of"
- echo " machines in the same directory."
- echo ""
- echo -n "Do you really want to create new makefiles? (y/n) [return] > "
- set confirm=$<
- switch ($confirm)
- case y:
- breaksw
- default:
- echo "EXIT: snns.make not changed."
- exit 0
- endsw
- echo ""
- echo ""
-
- set mfpermission=664
-
- if ( -e ./kernel/sources/Makefile) then
- echo -n "kernel : Copying current Makefile to Makefile.bak ... "
- /bin/cp ./kernel/sources/Makefile ./kernel/sources/Makefile.bak
- echo "Done."
- endif
- if ( -e ./xgui/sources/Makefile) then
- echo -n "xgui : Copying current Makefile to Makefile.bak ... "
- /bin/cp ./xgui/sources/Makefile ./xgui/sources/Makefile.bak
- echo "Done."
- endif
- if ( -e ./compiler/sources/Makefile) then
- echo -n "compiler: Copying current Makefile to Makefile.bak ... "
- /bin/cp ./compiler/sources/Makefile ./compiler/sources/Makefile.bak
- echo "Done."
- endif
- if ( -e ./tools/sources/Makefile) then
- echo -n "tools : Copying current Makefile to Makefile.bak ... "
- /bin/cp ./tools/sources/Makefile ./tools/sources/Makefile.bak
- echo "Done."
- endif
-
-
- cat ./configuration/header >! ./snns.make.tmp
- echo "# Created by `logname` at `date`" >> ./snns.make.tmp
- echo "" >> ./snns.make.tmp
- echo "# -- SNNS Installation Directories & Libraries --" >> ./snns.make.tmp
- echo ""
- echo "For installation, we need the full path to your current directory"
- echo "but without auto-mount prefix (like /tmp_mnt/...)"
- echo "Current directory:"
- echo " " $cwd
- echo -n "Is this your current directory without auto-mount prefix? (y/n) [return] > "
- set confirm=$<
- switch ($confirm)
- case n:
- echo ""
- echo "Please enter the FULL path of your current directory"
- echo "but without auto-mount prefix."
- echo -n "> "
- set rootdir=$<
- breaksw
- default:
- set rootdir = `echo $cwd`
- breaksw
- endsw
-
- echo "SNNSDIR = $rootdir" >> ./snns.make.tmp
-
-
- echo ""
- echo "Installation directory:"
- echo -n " " $rootdir
- echo "/<kernel,xgui,tools>/bin"
- echo " /<sun_os4x,ibm_aix,hp_ux,dec_mips,dec_alpha,"
- echo " sgi_irix,sun_solaris,pc_linux,other"
- echo -n "Do you want to change the installation directory ? (y/n) [return] > "
- set confirm=$<
- switch ($confirm)
- case y:
- echo ""
- echo "Please enter the FULL path of your new installation directory"
- echo "but without auto-mount prefix."
- echo -n "> "
- set InstallDir=$<
- breaksw
- default:
- set InstallDir
- breaksw
- endsw
-
-
- # machine #############################################
-
- echo ""
- echo ""
- echo "Select your machine"
- echo " [1] SPARCstation"
- echo " [2] Decstation"
- echo " [3] RS 6000"
- echo " [4] HP 9000"
- echo " [5] Silicon Graphics"
- echo " [6] PC 386/486 Linux"
- echo " [7] Other"
- echo -n "Enter number 1-7 > "
- set machine=$<
- set ldoptions = ( '-L$(XDIR) -lXaw -lXmu -lXt -lXext -lX11 -lm' )
- switch ($machine)
- case 1:
- echo "MACHINE = sun4" >> ./snns.make.tmp
- set ccflags = "-O"
- set fpoptions = ""
- set thismachine = "sun_os4x"
- set machinename = "Sparc Series"
- breaksw
- case 2:
- echo "MACHINE = dec" >> ./snns.make.tmp
- set ccflags = "-O2 -Olimit 3000 -Dconst=''"
- set fpoptions = "-float"
- set machinename = "Digital DecStation"
- set thismachine = "dec_mips"
- breaksw
- case 3:
- echo "MACHINE = RS6000" >> ./snns.make.tmp
- set ccflags = "-O"
- set fpoptions = "-float"
- set machinename = "IBM Risc Station 6000"
- set thismachine = "ibm_aix"
- breaksw
- case 4:
- echo "MACHINE = HP9000" >> ./snns.make.tmp
- set ccflags = "-O -Aa -D_HPUX_SOURCE"
- set fpoptions = ""
- set machinename = "Hewlett-Packard Series 9000"
- set thismachine = "hp_ux"
- breaksw
- case 5:
- echo "MACHINE = sgi" >> ./snns.make.tmp
- set ccflags = "-O"
- set fpoptions = ""
- set machinename = "Silicon Graphics"
- set thismachine = "sgi_irix"
- breaksw
- case 6:
- echo "MACHINE = 386" >> ./snns.make.tmp
- set ccflags = "-O -DSYSTEMV"
- set machinename = "PC System V/386"
- set thismachine = "pc_linux"
- breaksw
- default:
- echo "MACHINE = other" >> ./snns.make.tmp
- set ccflags = ""
- set fpoptions = ""
- set machinename = "Unknown"
- set thismachine = "other"
- breaksw
- endsw
-
-
- echo ""
- echo ""
-
- # compiler ##########################################
-
-
- if ( $thismachine == dec_mips ) then
- echo "Do you have an Alpha Workstation ? (y/n) [return] > "
- set is_alpha=$<
- if ( $is_alpha == y ) then
- set ccflags = "-non_shared -Dconst=''"
- set fpoptions = "-float -ieee_with_inexact"
- set ldoptions = ( $ldoptions "-ldnet_stub" )
- set thismachine = "dec_alpha"
- endif
- endif
-
- set os = `uname -a`
- echo -n "Do you want to use the GNU-C Compiler ? (y/n) [return] > "
- set use_gcc=$<
- if ( $use_gcc == y ) then
- set compiler = gcc
- set ccflags = "-O4"
- if ( $thismachine == dec_mips ) then
- set ccflags = ( $ccflags -fno-omit-frame-pointer -Dultrix)
- endif
- if ( $thismachine == sgi_irix ) then
- set ccflags = ( $ccflags -w)
- endif
- if ( ( $os[1] == SunOS ) && ($os[3]:r == 5 ) ) then
- set thismachine = "sun_solaris"
- endif
- set fpoptions = ""
- else
- set compiler = cc
- if ( ( $os[1] == SunOS ) && ($os[3]:r == 5 ) ) then
- set ccflags = "-O -w"
- set thismachine = "sun_solaris"
- endif
- endif
-
- if ( $thismachine != pc_linux ) then
- set ldoptions = ( $ldoptions -ll )
- endif
-
-
- echo "MACHINENAME= $thismachine" >> ./snns.make.tmp
-
- echo "COMPILER = $compiler" >> ./snns.make.tmp
- echo "CCFLAGS = $ccflags" >> ./snns.make.tmp
- echo "FPOPTIONS = $fpoptions" >> ./snns.make.tmp
-
- echo ""
-
- # ranlib #############################################
-
- if ( -e /usr/bin/ranlib ) then
- echo "RLIB = ranlib" >> ./snns.make.tmp
- else
- echo "RLIB = echo" >> ./snns.make.tmp
- endif
-
- echo ""
- echo ""
-
- # libraries #############################################
-
- set xlib = /usr/local/X11R5/lib
- while (! -e $xlib/libX11.a )
- echo "X Libraries not found in $xlib"
- echo "Please enter full path of the X11 libraries"
- echo -n "> "
- set xlib=$<
- if ($xlib == "unknown") break
- end
- echo "X11 libraries located."
- echo "XDIR = $xlib" >> ./snns.make.tmp
-
- # includes #############################################
-
- echo ""
- set xh = /usr/local/X11R5/include
- while (! -e $xh/X11/Xaw/Label.h )
- echo "X11 include directory is not $xh"
- echo "Please enter full path of the X11 include files"
- echo -n "> "
- set xh=$<
- if ($xh == "unknown") break
- end
- echo "X11 include directory located."
- echo "XH = $xh" >> ./snns.make.tmp
-
-
-
- echo ""
- echo ""
- echo "************************************************"
- echo "* *"
- echo "* SNNS - Stuttgart Neural Network Simulator *"
- echo "* *"
- echo "* selected configuration *"
- echo "* *"
- echo "************************************************"
- echo ""
- echo "Machine: " $machinename
- echo ""
- echo "Compiler: " $compiler
- echo ""
- echo "SNNS sources in "
- echo " 1) $rootdir/kernel/sources"
- echo " 2) $rootdir/xgui/sources"
- echo " 3) $rootdir/tools/sources"
- # echo " 3) $rootdir/compiler/sources"
- echo ""
- echo "X Windows Version 11 Release 5 "
- echo " libraries in " $xlib
- echo " header file directory in " $xh
- echo ""
- echo -n "Is this correct ? (y/n) [return] > "
- set confirm=$<
- switch ($confirm)
- case n:
- echo "EXIT: snns.make unchanged."
- /bin/rm -f ./snns.make.tmp
- exit 0
- default:
- echo ""
- echo -n "Building makefiles ..."
-
- # if ( 0 ) then
-
- # Kernel
- set KERNELROOTDIR = $rootdir/kernel/sources
- /bin/cp ./snns.make.tmp $KERNELROOTDIR/Makefile
- cat $rootdir/configuration/kernelstuff >> $KERNELROOTDIR/Makefile
- # cat $rootdir/configuration/depend.kernel >> $KERNELROOTDIR/Makefile
- chmod $mfpermission $KERNELROOTDIR/Makefile
- if (! -d $rootdir/kernel/bin/$thismachine) then
- mkdir $rootdir/kernel/bin/$thismachine
- endif
- if ( $InstallDir != "" ) then
- set bindir = $InstallDir
- if (! -d $bindir) then
- mkdir $bindir
- endif
- else
- set bindir = $rootdir/kernel/bin/$thismachine
- endif
- echo "s&____&$bindir&g" > $rootdir/configuration/Temp
- sed -f $rootdir/configuration/Temp $KERNELROOTDIR/Makefile > $KERNELROOTDIR/m.new
- /bin/mv $KERNELROOTDIR/m.new $KERNELROOTDIR/Makefile
- /bin/rm $rootdir/configuration/Temp
- chmod $mfpermission $KERNELROOTDIR/Makefile
-
-
-
- # XGUI
- set XGUIROOTDIR = $rootdir/xgui/sources
- echo "LDOPTIONS = $ldoptions" >> ./snns.make.tmp
- /bin/cp ./snns.make.tmp $rootdir/xgui/sources/Makefile
- cat $rootdir/configuration/xguistuff >> $XGUIROOTDIR/Makefile
- # cat $rootdir/configuration/depend.xgui >> $XGUIROOTDIR/Makefile
- if (! -d $rootdir/xgui/bin/$thismachine) then
- mkdir $rootdir/xgui/bin/$thismachine
- endif
- if ( $InstallDir != "") then
- set bindir = $InstallDir
- if (! -d $bindir) then
- mkdir $bindir
- endif
- echo ""
- echo -n "Copying xgui files: help.hdoc, default.cfg ..."
- /bin/cp $rootdir/xgui/bin/help.hdoc $InstallDir
- /bin/cp $rootdir/xgui/bin/default.cfg $InstallDir
- echo "Done."
- echo ""
- else
- set bindir = $rootdir/xgui/bin/$thismachine
- endif
- echo "s&____&$bindir&g" > $rootdir/configuration/Temp
- sed -f $rootdir/configuration/Temp $XGUIROOTDIR/Makefile > $XGUIROOTDIR/m.new
- /bin/mv $XGUIROOTDIR/m.new $XGUIROOTDIR/Makefile
- /bin/rm $rootdir/configuration/Temp
- chmod $mfpermission $XGUIROOTDIR/Makefile
-
- # Compiler
- # set COMPILERROOTDIR = $rootdir/compiler/sources
- # /bin/cp ./snns.make.tmp $rootdir/compiler/sources/Makefile
- # cat $rootdir/configuration/compilerstuff >> $COMPILERROOTDIR/Makefile
- # cat $rootdir/configuration/$thismachine.compiler >> $COMPILERROOTDIR/Makefile
- # cat $rootdir/configuration/depend.compiler >> $COMPILERROOTDIR/Makefile
- # if (! -d $rootdir/compiler/bin/$thismachine) then
- # mkdir $rootdir/compiler/bin/$thismachine
- # endif
- # if ( $InstallDir != "") then
- # set bindir = $InstallDir
- # if (! -d $bindir) then
- # mkdir $bindir
- # endif
- # else
- # set bindir = $rootdir/compiler/bin/$thismachine
- # endif
- # echo "s&____&$bindir&g" > $rootdir/configuration/Temp
- # sed -f $rootdir/configuration/Temp $COMPILERROOTDIR/Makefile > $COMPILERROOTDIR/m.new
- # /bin/mv $COMPILERROOTDIR/m.new $COMPILERROOTDIR/Makefile
- # /bin/rm $rootdir/configuration/Temp
- # chmod $mfpermission $COMPILERROOTDIR/Makefile
-
- # endif
-
- # tools
- set TOOLSROOTDIR = $rootdir/tools/sources
- echo "LDOPTIONS = $ldoptions" >> ./snns.make.tmp
- /bin/cp ./snns.make.tmp $rootdir/tools/sources/Makefile
- cat $rootdir/configuration/toolstuff >> $TOOLSROOTDIR/Makefile
- # cat $rootdir/configuration/depend.tools >> $TOOLSROOTDIR/Makefile
- if (! -d $rootdir/tools/bin/$thismachine) then
- mkdir $rootdir/tools/bin/$thismachine
- endif
- if ( $InstallDir != "") then
- set bindir = $InstallDir
- if (! -d $bindir) then
- mkdir $bindir
- endif
- echo ""
- echo "Done."
- echo ""
- else
- set bindir = $rootdir/tools/bin/$thismachine
- endif
- echo "s&____&$bindir&g" > $rootdir/configuration/Temp
- sed -f $rootdir/configuration/Temp $TOOLSROOTDIR/Makefile > $TOOLSROOTDIR/m.new
- /bin/mv $TOOLSROOTDIR/m.new $TOOLSROOTDIR/Makefile
- /bin/rm $rootdir/configuration/Temp
- chmod $mfpermission $TOOLSROOTDIR/Makefile
-
-
- # END
- /bin/rm -f ./snns.make.tmp
- echo "Done."
-
-
- echo ""
- echo ""
- echo "************************************************"
- echo "* *"
- echo "* SNNS - Stuttgart Neural Network Simulator *"
- echo "* *"
- echo "************************************************"
- echo ""
- echo "If you start to build SNNS the first time for a new type"
- echo "of machine then first delete all object files with the"
- echo "command:"
- echo " ./cleanup all"
- echo ""
- echo "Then type:"
- echo ""
- echo "./build all - to build all SNNS modules"
- echo "./build sim - to build kernel and xgui"
- echo "./build kernel - to build kernel only"
- echo "./build xgui - to build xgui only"
- echo "./build tools - to build the tools only"
- # echo "./build compiler - to build the Nessus compiler only"
- echo ""
- if ( $InstallDir != "" ) then
- echo "SNNS will be placed in:"
- echo "$InstallDir"
- echo ""
- echo "All libraries will be placed in:"
- else
- echo "All the relevant binaries will be placed in:"
- endif
- echo "$rootdir/(SNNS module)/bin"
- echo ""
- echo "All examples will be found in:"
- echo "$rootdir/(SNNS module)/examples"
- echo ""
- echo "Remark: You can use ./cleanup with the same parameters"
- echo " used with the ./build program."
- echo ""
-
- breaksw
- endsw
-
-